﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Interface;
using Controller;
using System.ServiceModel;

namespace Pumpestation
{
    class Program
    {
        static void Main(string[] args)
        {
            int Nr = -1;
            int.TryParse(Console.ReadLine(), out Nr);

            if(Nr > 0)
            {
                ClsController C = new ClsController();
                
                ServiceHost Host = new ServiceHost(C);
                Host.AddServiceEndpoint(typeof(IClsController), new NetTcpBinding(), "net.tcp://localhost:" + Nr + "/");
                
                Host.Open();
                C.Start(Nr);
                Console.ReadLine();
                Host.Close();
            }
        }
    }
}
